<oc-dialog oc-dialog-is-full="true"
	oc-dialog-switch="MS"
	oc-dialog-icon="lemoncelogo"
	oc-dialog-title="LEMONCE - 自动化测试探针 v0.7.1">
	<div ng-controller="Main" class="grid" style="height:100%;width:100%">
		<oc-list-menu content="menu"></oc-list-menu>
		<nav class="oc-toolbar" style="border-bottom:1px solid #aaa;top:1rem">
			<button class="back ico" ng-click="history.go(-1)"></button>
			<button class="next ico" ng-click="history.go(1)"></button>
			<oc-address oc-address-iframe="project" style="width:30rem"></oc-address>

			<button class="play ico" ng-click="buildAndPlay()"
				ng-show="p.status=='idle'"
				title="构建&启动"></button>
			<button class="play ico" ng-click="resume()"
				ng-show="p.status=='wait'"
				title="继续"></button>
			<button class="pause ico" ng-click="pause()"
				ng-show="p.status=='run'"
			    ng-disabled="caseInstance.$$currentLoop<1"
				title="暂停"></button>
			<button class="stop ico" ng-click="stop()"
				ng-disabled="p.status=='idle'"
				title="终止"></button>

			<button class="highlight ico" ng-class="{'no-highlight':!highlightIns}"
	            ng-click="highlightIns=!highlightIns" title="指令高亮"></button>
			<input type="text" style="width:8rem" id="engine-status"
			       readonly ng-model="status"/>

			<hr/>
			<label>宽：</label>
			<input type="text" style="width:4em"
				ng-model="project.width" ng-disabled="isProjectFull"
				ng-model-options="{getterSetter:true,updateOn:'blur'}" />
			<label style="margin-left:.3rem">高：</label>
			<input type="text" style="width:4em"
				ng-model="project.height" ng-disabled="isProjectFull"
				ng-model-options="{getterSetter:true,updateOn:'blur'}" />
			<button class="full-screen ico" ng-click="fullScreen()"
				ng-class="{active:isProjectFull}"></button>
			<button class="resizable ico" ng-click="isProjectFull=false"
				ng-class="{active:!isProjectFull}"></button><hr/>
			<button class="panelactive ico"
				ng-click="togglePanel()" ng-class="{active:!isInactive}"></button>
		</nav>
		<div class="grid" ng-style="iframeGrid" id="projectGrid"
			style="top:2.5rem;right:20rem;bottom:0;left:0">
			<iframe ng-src="{{homeUrl||'about:blank'}}" id="project"
				style="width:100%;height:100%;border:none" ng-style="iframeSize"></iframe>
		</div>
		<div class="grid" ng-hide="isInactive" ng-controller="CaseEditor"
			style="top:2.5rem;bottom:0;right:0;width:20rem;background-color:#f2f2f2;
			border-left:1px solid #aaa">
			<div class="oc-handle" style="left:1rem;right:1rem;height:1rem"></div>
			<button class="fixed ico" ng-click="fixedPanel()" ng-class="{active:isFixed}"
				style="top:0;left:0;width:1rem;height:1rem"></button>
			<button class="minimize ico" ng-click="togglePanel()"
				style="top:0;right:0;width:1rem;height:1rem"></button>
			<nav class="oc-toolbar" style="top:1rem;width:100%">
				<button class="new ico" ng-click="newCase()" title="新建"></button>
				<button class="open ico" ng-click="openCase()" title="打开"></button>
				<button class="save ico" ng-click="saveCase()" title="保存"></button>
				<button class="caseDelete ico" oc-alert-open="deleteCase"
					title="删除用例"></button><hr/>
				<button class="dictionary ico" ng-click="openDictionary()" title="字典"></button>
				<input type="text" readonly
					ng-model="dictionary.name" style="width:5.5rem"/>
				<button class="right ico codeView" title="编码模式"
					ng-class="{active:editorMode=='code'}"
					ng-click="editorMode='code'"></button>
				<button class="right ico easyView" title="简单模式"
					ng-class="{active:editorMode=='simple'}"
					ng-disabled="!isCaseSimple" ng-click="editorMode='simple'"></button>
			</nav>

			<div ng-show="editorMode=='simple'" class="grid"
				ng-controller="CaseEditorSimple"
				style="top:2.5rem;bottom:0;left:0rem;right:0rem;width:auto;height:auto">
				<label style="top:.3rem;left:.3rem;right:.3rem"
					for="simple-case-origin">起始页：</label>
				<input type="text" ng-model="simpleCase.origin" ng-disabled="simpleCase.noOrigin"
					style="top:1.4rem;left:.3rem;width:17.4rem" id="simple-case-origin"/>
				<button class="terminal" ng-click="fillOrigin()"
					style="top:1.4rem;right:1.4rem;width:1.1rem;height:1.1rem;margin-right:-1px"></button>
				<button class="forbid" ng-click="simpleCase.noOrigin = !simpleCase.noOrigin"
		            style="top:1.4rem;right:.3rem;width:1.1rem;height:1.1rem"></button>
				<!--控制按键-->
				<button class="wait ico"
					oc-dialog-open="{name:'addIns/wait',share:shareFn}"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;left:.3rem"
					title="追加等待指令"></button>
				<button class="action ico"
					oc-dialog-open="{name:'addIns/action',share:shareFn}"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;left:1.5rem"
					title="追加动作指令"></button>
				<button class="assert ico"
					oc-dialog-open="{name:'addIns/assert',share:shareFn}"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;left:2.7rem"
					title="追加断言指令"></button>
				<button class="trash ico" oc-alert-open="trashCase" title="清空"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;left:3.9rem"></button><hr/>
				<button class="delete ico" ng-click="deleteIns()"
					ng-disabled="ILC.selected<0||ILC.selected>=simpleCase.instructions.length"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;right:2.7rem"
					title="删除"></button>
				<button class="up ico" ng-click="up()" ng-disabled="ILC.selected<=0"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;right:1.5rem"
					title="上移"></button>
				<button class="down ico" ng-click="down()"
					ng-disabled="ILC.selected<0||ILC.selected>=(simpleCase.instructions.length-1)"
					style="top:3rem;width:1.1rem;height:1.1rem;width:1.1rem;right:.3rem"
					title="下移"></button>
				<oc-list oc-list-data="simpleCase.instructions"
					oc-list-control="ILC"
					oc-list-refresh="instructionListRefresh"
					style="bottom:3rem;border:1px solid #AAA;right:.3rem;left:.3rem;top:4.3rem"></oc-list>
						
				<label style="bottom:1.3rem;left:.3rem;width:5rem" for="max-loop">循环数：</label>
				<input type="text" ng-model="simpleCase.maxLoop" ng-change="checkMaxLoop()"
					style="bottom:.3rem;width:4rem;left:.3rem" id="max-loop"/>
				<label style="bottom:1.3rem;width:6.8rem;left:4.6rem"
					for="next-loop-delay">循环间距：</label>
				<input type="text" ng-model="simpleCase.nextLoopDelay"
					style="bottom:.3rem;width:6.8rem;left:4.6rem" id="next-loop-delay" />

			</div><!-- //Simple Mode -->

			<div ng-show="editorMode=='code'" class="grid"
				ng-controller="CaseEditorCode"
				style="top:2.5rem;bottom:0;left:0rem;right:0rem;width:auto;height:auto">
				<!--coding-->
				<button ng-click="parse()" class="ico parsing" ng-show="!isCaseSimple"
					title="分析" style="left:.3rem;top:.3rem"></button>
				<button ng-click="undo()" class="ico undo" ng-show="!isCaseSimple"
					title="撤销(Ctrl+z)" style="left:1.5rem;top:.3rem"></button>
				<button ng-click="redo()" class="ico redo" ng-show="!isCaseSimple"
					title="重复(Ctrl+r)" style="left:2.7rem;top:.3rem"></button>
				<button ng-click="capture()" class="ico search" ng-show="!isCaseSimple"
					title="插入选择器" style="left:3.9rem;top:.3rem"></button>
				<button ng-click="insertField()" class="ico object" ng-show="!isCaseSimple"
					title="插入字段" style="left:5.1rem;top:.3rem" ng-disabled="!dictionary.field"></button>
				<button ng-click="enableCoding()" ng-show="isCaseSimple"
					style="width:3.6rem;height:1.1rem;top:.3rem;right:.3rem">启用编辑</button>
				<!--<input type="checkbox" name="c" id="c"/>-->
				<!--<label for="c">自动插入return</label>-->
				<div style="position:absolute;top: 1.5rem;height:auto;bottom:4.5rem;left:0;right:0;
					border:solid #ccc;border-width:1px 0"  ng-if="!isCaseSimple">
					<textarea ui-codemirror="editorOptions" ng-model="case.code"
						ui-refresh="caseCodeMirrorRefresh"></textarea>
				</div>
				<div style="position:absolute;top: 1.5rem;height:auto;bottom:4.5rem;left:0;right:0;
					border:solid #ccc;border-width:1px 0" ng-if="isCaseSimple">
					<textarea ui-codemirror="editorOptions" ng-model="code"
						ui-refresh="caseCodeMirrorRefresh"></textarea>
				</div>
				<pre style="position:absolute;height:3.5rem;left:0;right:0;bottom:0;
					padding:.5rem;overflow:auto">{{parseConsole}}</pre>
			</div><!-- //Source Mode -->

		</div>
		<a class="ico feedback" target="_blank" href="http://git.oschina.net/increase/LemonProbe/issues"
			style="right:.3rem;top:.3rem"></a>
		<div ng-show="mask" class="grid"
			style="left:0;right:0;top:2.5rem;bottom:0;background-color:#000;opacity:.1;z-index:1"></div>
	</div>
</oc-dialog>
